home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / biz / dopus / PlayHIP.lha / PlayHIP / arexx / PlayMod_HIP.dopus5 < prev   
Text File  |  1998-01-09  |  3KB  |  155 lines

  1. /*Hip Module-Player v2.01 09-01-1998 for Directory Opus 5.
  2.   By Sampo Kytömäki (MY first AREXX program ever:)
  3.   Email: sam@softavenue.fi
  4.  
  5. $VER: Play_HIP.dopus5 2.00 (05.08.97)
  6.  
  7. Most of the code stolen :(
  8.  
  9.    To use it you may call it from the 'Double-click' function for the
  10.    'Music module' filetype. Enter the following command:
  11.    <ARexx> DOpus5:arexx/PlayMod_HIP.dopus5 {f}
  12.  
  13.    History:
  14.    0.50 13-11-1995
  15.    very buggy but works somehow
  16.  
  17.    0.70 13-11-1995
  18.    now works fine
  19.  
  20.    0.80 13-12-1995
  21.    some code cleanup
  22.  
  23.    1.00 14-12-1995
  24.    Wou !!
  25.    few bugs fixed
  26.  
  27.    2.00 04-08-1997
  28.    added "Show/Hide samples" button
  29.    added duration and other new things to module info
  30.    added time limit to checkloop
  31.    added instant play when loading hip (no list loading any more)
  32.    fixed bugs (too many to mention)
  33.    found and fixed major bug in hip loading, after two years :)
  34.  
  35.    2.01 09-01-98
  36.    updated email address
  37.    fixed for public release
  38.  
  39. */
  40.                       
  41. HIPPO='HD1:Music/HippoPlayer/HIP'   /* Path for your hippo*/
  42.  
  43. parse arg '"' module '"'
  44. lf='0a'x
  45. OPTIONS Results
  46.  
  47. result = SHOW('Ports', 'HIPPOPLAYER')
  48. if result=0 then DO
  49.         ADDRESS DOPUS.1
  50.          dopus request '"HippoPlayer is not Running!'lf'Loading HippoPlayer"' 'OK|Cancel'
  51.           if RC = 1 then signal load
  52.            end
  53.            else signal play
  54.            end
  55.            else exit
  56.         end
  57.       end
  58.  
  59. info:
  60. ADDRESS 'HIPPOPLAYER'
  61. options results
  62.  
  63. get name
  64. name = result
  65.  
  66. get fnam
  67. fnam = result
  68.  
  69. get type
  70. type = result
  71.  
  72. get size
  73. size = result
  74.  
  75. get comm
  76. comm = result
  77.  
  78. get csng
  79. csng = result 
  80.  
  81. get nsng
  82. nsng =  result
  83.  
  84. get mspo
  85. mspo = result
  86.  
  87. get dura
  88. if result == 0 then do
  89. durt = "  Duration not available  "  "  "
  90. end
  91. else do
  92. duration = result
  93.     zero = ''             /* Duration format changing ripped  */
  94.                              /*   from TotalDuration.hip         */
  95.     hrs = ''            /* (C) Tomasz Kepa 09.VII.1996      */
  96.     mins = duration % 60
  97.     secs = duration // 60
  98.     hours = mins % 60
  99.  
  100.     if secs < 10 then zero = '0'
  101.     if mins >= 60 then mins = MINS - (HOURS * 60)
  102.     if hours ~= 0 then
  103.         do
  104.             hrs = hours':'
  105.                          end
  106.             if mins < 10 then hrs = hrs'0'
  107.  
  108. durt = "  Duration: '"hrs''mins':'zero''secs"'"
  109. end
  110.  
  111. signal infowindow
  112.  
  113. infowindow:
  114. address 'DOPUS.1'
  115. dopus request '"Module info'lf'¯¯¯¯¯¯¯¯¯¯¯¯¯¯'lf'Loaded module:' name''lf'Full name of the loaded module:' fnam''lf'Type of the loaded module:' type''lf'Size of the loaded module: 'size''lf'Filecomment for the loaded module:' comm''lf'Current song:' csng''lf'Number of songs:'nsng''lf'Maximum songposition:'mspo''lf''durt'" Quit|Stop|Leave Playing|Show/Hide Samples'
  116. if RC = "1" THEN signal quit
  117. if RC = "2" THEN signal stop
  118. if RC = "3" THEN exit
  119. else signal sample
  120.    end
  121.   end
  122.  end
  123. end
  124.  
  125. stop:
  126. address 'HIPPOPLAYER'
  127. stop
  128.  exit
  129.  
  130. quit:
  131. address 'HIPPOPLAYER'
  132. stop
  133.  quit
  134.   exit
  135.  
  136. sample:
  137. address 'HIPPOPLAYER'
  138.  samples
  139.   signal infowindow
  140.    exit
  141.  
  142. play:
  143. ADDRESS 'HIPPOPLAYER'
  144.  play module 
  145.   signal info
  146.  
  147. load:
  148. ADDRESS COMMAND HIPPO '"'module'"'
  149.   delay(50)
  150.    If ~Show("P","HIPPOPLAYER") then do
  151.     dopus request '"Error loading HippoPlayer!'lf'Check its command-path in the ARexx script." OK'
  152.   end
  153.  else signal info
  154. end
  155.